﻿<Window x:Class="EmployeeTracker.View.CountriesDetailView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:v="clr-namespace:EmployeeTracker.View"
        xmlns:vm="clr-namespace:EmployeeTracker.ViewModel"        
        Title="Manage Titles" Height="800" Width="700" DataContext="{Binding}">
    <Window.Resources>
        <DataTemplate DataType="{x:Type vm:CountriesDetailViewModel}"> 
        </DataTemplate>
    </Window.Resources>
        
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="161*"/>
            <ColumnDefinition Width="185*"/>
        </Grid.ColumnDefinitions>
        <Border Style="{StaticResource DetailBorder}" Margin="0,-10,0,10" Grid.ColumnSpan="2">
            <DataGrid Name="grdCountry" SelectedItem="{Binding Path=.CurrentCountry, Mode=TwoWay}" ItemsSource="{Binding Path=AllCountries}" AutoGenerateColumns="False" Margin="0,7,504,0" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Country" Width="Auto" Binding="{Binding Path=CountryName}" />
                </DataGrid.Columns>
            </DataGrid>
        </Border>
        <Label HorizontalAlignment="Left" Content="Country" Background="Aquamarine" Margin="161,10,0,0" VerticalAlignment="Top" Height="27" RenderTransformOrigin="0.5,0.5" Width="61" Grid.Column="1"/>

        <TextBox HorizontalAlignment="Left" Height="23" Margin="240,14,0,0" VerticalAlignment="Top" Width="120" Text="{Binding Path= .CurrentCountry.CountryName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged }"  Grid.Column="1"/>
        <Label HorizontalAlignment="Left" Content="Nationality" Background="Aquamarine" Margin="161,52,0,0" VerticalAlignment="Top" Height="27" RenderTransformOrigin="0.5,0.5" Width="70" Grid.Column="1"/>
        <TextBox HorizontalAlignment="Left" Height="23" Margin="240,56,0,0" VerticalAlignment="Top" Width="120" Text="{Binding Path=.CurrentCountry.CountryNationality,  Mode=TwoWay , UpdateSourceTrigger=PropertyChanged }" Grid.Column="1"/>
        <Button HorizontalAlignment="Left" Content="Add New" Margin="178,106,0,0" VerticalAlignment="Top" Width="121" Height="22" Command="{Binding Path=AddNewCommand}" Grid.Column="1"/>
        <Button HorizontalAlignment="Left" Content="Save" Margin="178,133,0,0" VerticalAlignment="Top" Width="121" Height="22" Command="{Binding Path=SaveCommand}"  Grid.Column="1"/>
        <Button HorizontalAlignment="Left" Content="Cancel" Margin="178,187,0,0" VerticalAlignment="Top" Width="121" Height="22" Command="{Binding Path=CancelCommand}" Grid.Column="1"/>
        <Button HorizontalAlignment="Left" Content="Close" Margin="178,160,0,0" VerticalAlignment="Top" Width="121" Height="22" Command="{Binding Path=CloseCommand}" Grid.Column="1"/>


    </Grid>
</Window>
